package com.billing.persistance.entities;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.springframework.security.core.GrantedAuthority;

@Entity
@Table(name="TECH_USER_AUTHORITY")
public class TechGrantedAuthority implements GrantedAuthority {

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column (name="ID")
    private Long id;
    
    @Column (name="ROLE")
    private String role;
    
    @ManyToOne()
    @JoinColumn(name = "id")
    private TechUser techUser;
    
    public String getAuthority() {
        return role;
    }
    
    
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }

}

